There are a few places where we destroy a cairo surface and
then nullify it. This commit changes those to use
g_clear_pointer instead.
It also drops a cairo_surface_finish call that is unnecessary
https://bugzilla.gnome.org/show_bug.cgi?id=761312
GdkRectangle area;
cairo_region_t *region;
- if (impl->cairo_surface)
- {
- cairo_surface_destroy (impl->cairo_surface);
- impl->cairo_surface = NULL;
- }
+ g_clear_pointer (&impl->cairo_surface, cairo_surface_destroy);
window->width = width;
window->height = height;
gdk_wayland_window_hide_surface (window);
- if (impl->cairo_surface)
- {
- cairo_surface_finish (impl->cairo_surface);
- cairo_surface_destroy (impl->cairo_surface);
- impl->cairo_surface = NULL;
- }
+ g_clear_pointer (&impl->cairo_surface, cairo_surface_destroy);
}
static void